package com.artic;

import org.primefaces.comet.CometContext;

import java.io.Serializable;
import java.util.Date;

import javax.faces.application.FacesMessage;
import javax.faces.bean.ApplicationScoped;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.SessionScoped;
import javax.faces.context.FacesContext;
import javax.faces.event.ActionEvent;


/**
 * Created by IntelliJ IDEA.
 * User: czarnik_a
 * Date: 26.01.11
 * Time: 12:46
 * To change this template use File | Settings | File Templates.
 */
@ManagedBean
@ApplicationScoped
public class ChatBean implements Serializable {

	private String message = "";
    private String chatText = "[Welcome to the Chat]...";

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        Date date = new Date();
        int hours = date.getHours();
        int minutes = date.getMinutes();
        chatText += "["+hours+":"+minutes+"]"+message+"<br/>";
    }

    public String getChatText() {
        return chatText;
    }


    public void increment() {
    }
}
